package demo.cb;

public class FeRateDao {

    public FeRateBean queryFeRateBeanVo(String id) {
        String sql = "SELECT name, value, age FROM FE_RATE WHERE id=" + id;

        return queryBean(sql, FeRateBean.class, id);
    }

    public <T> T queryBean(String sql, Class<?> clazz, String id) {
        try {
            //连数据库
            return (T) clazz.newInstance();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    public static void main(String[] args) {
        FeRateBean feRateBean= new FeRateDao().queryFeRateBeanVo("1");
        System.out.println(feRateBean.getAge());
    }
}

